package com.cetc.domain;

import com.cetc.anno.MyAnnotation;
import com.cetc.inter.IMyInterface;

import java.io.IOException;

/**
 * @Classname Animal
 * @Description 动物类
 * @Date 2022/12/12 20:03
 * @Created by louzhuangxi
 */
@MyAnnotation(value = "hi")
public class Animal extends Creature<String> implements Comparable<String>, IMyInterface {

    @MyAnnotation
    private String name;
    int age;
    public int id;

    public Animal() {
    }

    @MyAnnotation(value = "abc")
    private Animal(String name) {
        this.name = name;
    }

    Animal(String name, int age) {
        this.name = name;
        this.age = age;
    }

    @Override
    public void eat() {
        System.out.println("我是一只动物～～～");
    }

    @Override
    public int compareTo(String o) {
        return 0;
    }

    @MyAnnotation(value = "def")
    private String show(String nation) throws IOException {
        return "我的国籍是:" + nation;
    }

    public String display(String interest, int age) {
        return interest + age;
    }

    private static void showDesc(String msg){
        System.out.println(msg);
    }

    public String getName() {
        return name;
    }

    @Override
    public String toString() {
        final StringBuffer sb = new StringBuffer("Animal{");
        sb.append("name='").append(name).append('\'');
        sb.append(", age=").append(age);
        sb.append(", id=").append(id);
        sb.append('}');
        return sb.toString();
    }
}
